package com.mybatis.service.Impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mybatis.mapper.UserMapper;
import com.mybatis.pojo.User;
import com.mybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ProjectName: mybatis_plus
 * @Package: com.mybatis.service.Impl
 * @ClassName: UserServiceImpl
 * @author: Arisapoke
 * @date: 2021/2/20 16:27
 * @Version: 1.0
 */

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    private UserService userService;

    @Override
    public IPage<User> userInfoTable() {
        Page<User> page = new Page<>(1, 3);
        IPage<User> createTime = userService.page(page, Wrappers.<User>query().orderByDesc("createTime"));
        return createTime;
    }
}
